{extend name="layout/base" /} {block name="main"}
<div class="row-content am-cf">
    <div class="row">
        <div class="am-u-sm-12 am-u-md-12 am-u-lg-12">
            <div class="widget am-cf">
                <div class="widget-head am-cf">
                    <div class="widget-title am-fl">添加/编辑</div>
                    <div class="widget-function am-fr">
                        <a href="{:url('tadmin.single')}" class="am-icon-list" title="列表"></a>
                    </div>
                </div>
                <div class="widget-body am-fr">
                    <form class="am-form tpl-form-border-form" method="post" enctype="multipart/form-data" data-am-validator>
                        <div class="row">
                        <div class="am-u-md-12 am-u-lg-9">
                            <div class="am-panel am-panel-default">
                                <div class="am-panel-hd">基础信息</div>
                                <div class="am-panel-bd">
                                    <div class="am-form-group">
                                        <label for="user-name" class="am-u-sm-12 am-form-label am-text-left">单页标题 <span class="tpl-form-line-small-title">（必填）</span></label>
                                        <div class="am-u-sm-12">
                                            <input name="title" value="{$article.title}" type="text" class="tpl-form-input am-margin-top-xs" placeholder="请输入标题文字" required>
                                            <small>建议10-20字左右，最长不超过100个字。</small>
                                        </div>
                                    </div>
                                    <div class="am-form-group">
                                        <label for="user-phone" class="am-u-sm-12 am-form-label am-text-left">绑定栏目 <span class="tpl-form-line-small-title">（必选）</span></label>
                                        <div class="am-u-sm-12  am-margin-top-xs">
                                            <select name="category_id" data-am-selected="{searchBox: 1, maxHeight: 250}" style="display: none;">
                                                {foreach $parents as $cate}
                                                <option value="{$cate.id}" {if ($cate.id==$article.category_id)}selected{/if} {if $cate.type!='single' }disabled{/if}>{$cate.prefix}{$cate.name}</option>
                                                {/foreach}
                                            </select>
                                            <small>每个栏目仅仅可绑定一个单页</small>
                                        </div>
                                    </div>
                                    <div class="am-form-group">
                                        <label for="user-weibo" class="am-u-sm-12 am-form-label  am-text-left">封面图 <span class="tpl-form-line-small-title">Images</span></label>
                                        <div class="am-u-sm-12 am-margin-top-xs">
                                            <div class="am-form-group am-form-file">
                                                <div class="tpl-form-file-img">
                                                    <img src="{$article.image}" class="am-thumbnail error-nopic" style="max-height: 120px;">
                                                </div>
                                                <button type="button" class="am-btn am-btn-danger am-btn-sm ">
                                                    <i class="am-icon-cloud-upload"></i> 添加封面图片</button>
                                                <input name="image" class="form-img" type="file">
                                            </div>
                                            <div class="file-list"></div>
                                        </div>
                                    </div>
                                    <div class="am-form-group">
                                        <label for="user-intro" class="am-u-sm-12 am-form-label  am-text-left">单页内容</label>
                                        <div class="am-u-sm-12 am-margin-top-xs">
                                            <textarea class="form-editor" id="content" data-editor="ueditor"  name="content">
                                                {$article.content|raw}
                                            </textarea >
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                        <div class="am-u-md-12 am-u-lg-3">
                            <div class="am-panel am-panel-default">
                                <div class="am-panel-hd">SEO</div>
                                <div class="am-panel-bd">                                    
                                    <div class="am-form-group">
                                        <label class="am-u-sm-12 am-form-label  am-text-left">SEO关键字 </label>
                                        <div class="am-u-sm-12">
                                            <input name="keywords" value="{$article.keywords}" type="text" class="am-margin-top-xs" placeholder="输入SEO关键字">
                                        </div>
                                    </div>
                                    <div class="am-form-group">
                                        <label for="user-intro" class="am-u-sm-12 am-form-label  am-text-left">单页摘要</label>
                                        <div class="am-u-sm-12 am-margin-top-xs">
                                            <textarea name="summary" class="" rows="3" placeholder="请输入文章摘要">{$article.summary}</textarea>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                        <div class="am-u-md-12 am-u-lg-3">
                            <div class="am-panel am-panel-default">
                                <div class="am-panel-hd">状态</div>
                                <div class="am-panel-bd">
                                    <div class="am-form-group">
                                        <label for="user-email" class="am-u-sm-12 am-form-label am-text-left">发布时间 <span class="tpl-form-line-small-title">Time</span></label>
                                        <div class="am-u-sm-12">
                                            <div class="am-input-group date datetimepicker-btn" data-date="{$article.created_at}" data-date-format="yyyy-mm-dd hh:ii:ss">
                                                <input name="created_at" type="text" value="{$article.created_at ?? date('Y-m-d H:i:s')}" class="am-form-field ">
                                                <span class="am-input-group-label add-on"><i class="icon-th am-icon-calendar"></i></span>
                                            </div>
                                            <small>发布时间为必填</small>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                        <div class="am-form-group">
                            <div class="am-u-sm-12 am-u-sm-push-12">
                                <input name="id" value="{$article.id}" type="hidden">
                                <button type="submit" class="am-btn am-btn-primary tpl-btn-bg-color-success ">提交</button>
                            </div>
                        </div>
                        </div>
                    </form>
                </div>
            </div>
        </div>
    </div>
</div>
{/block} {block name="footer"} {/block}